package com.yuji.aacar.controller.order.comment;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.Toast;

import com.yuji.aacar.R;
import com.yuji.aacar.base.BaseActivity;
import com.yuji.aacar.widgets.autolayout.AutoLinearLayout;
import com.yuji.aacar.widgets.autolayout.AutoRelativeLayout;
import com.yuji.aacar.widgets.ratingbar.MyRatingBar;
import com.yuji.aacar.widgets.textview.PingFangTextView;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class OrderCommentActivity extends BaseActivity implements MyRatingBar.OnRatingChangeListener{


    @BindView(R.id.title_back)
    ImageView titleBack;
    @BindView(R.id.back_image)
    AutoRelativeLayout backImage;
    @BindView(R.id.title_content)
    PingFangTextView titleContent;
    @BindView(R.id.back_login)
    PingFangTextView backLogin;
    @BindView(R.id.title_message_iv)
    ImageView titleMessageIv;
    @BindView(R.id.title_message_rl)
    AutoRelativeLayout titleMessageRl;
    @BindView(R.id.title_rl)
    AutoRelativeLayout titleRl;
    @BindView(R.id.order_comment_iv)
    ImageView orderCommentIv;
    @BindView(R.id.order_comment_product_name)
    PingFangTextView orderCommentProductName;
    @BindView(R.id.order_comment_product_detail)
    PingFangTextView orderCommentProductDetail;
    @BindView(R.id.order_comment_product_price)
    PingFangTextView orderCommentProductPrice;
    @BindView(R.id.order_comment_price_comment)
    PingFangTextView orderCommentPriceComment;
    @BindView(R.id.order_comment_layout1)
    AutoLinearLayout orderCommentLayout1;
    @BindView(R.id.service_ratingbar)
    MyRatingBar serviceRatingbar;
    @BindView(R.id.order_comment_submit_btn)
    Button orderCommentSubmitBtn;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        setContentView(R.layout.activity_order_comment);
        ButterKnife.bind(this);
        initTitle(true, "订单评价", null);

        super.onCreate(savedInstanceState);

        initRatingBar();
    }

    private void initRatingBar() {

//        serviceRatingbar.setStarEmptyDrawable(getResources().getDrawable(R.mipmap.star_empty));
//        serviceRatingbar.setStarHalfDrawable(getResources().getDrawable(R.mipmap.star_half));
//        serviceRatingbar.setStarFillDrawable(getResources().getDrawable(R.mipmap.star_full));
//        serviceRatingbar.setStarCount(5);
//        serviceRatingbar.setStar(2.5f);
//        serviceRatingbar.halfStar(true);
//        serviceRatingbar.setmClickable(true);
//        serviceRatingbar.setStarImageWidth(120f);
//        serviceRatingbar.setStarImageHeight(60f);
//        serviceRatingbar.setImagePadding(35);
        serviceRatingbar.setOnRatingChangeListener(this);
    }


    @Override
    public void alreadyBindBaseViewModel() {
        super.alreadyBindBaseViewModel();
        //        requestParams =
    }


    @Override
    protected void onDestroy() {
        super.onDestroy();
    }


    @OnClick({R.id.service_ratingbar, R.id.order_comment_submit_btn})
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.service_ratingbar:
                break;
            case R.id.order_comment_submit_btn:
                break;
        }
    }

    @Override
    public void onRatingChange(float RatingCount) {
        Toast.makeText(OrderCommentActivity.this, "the fill star is" + RatingCount, Toast.LENGTH_SHORT).show();

    }
}